//
//  toupiaoresultTableViewCell.m
//  hainingOASystem
//
//  Created by michael on 2017/12/4.
//  Copyright © 2017年 czd. All rights reserved.
//

#import "toupiaoresultTableViewCell.h"

@implementation toupiaoresultTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {

_label1 = [[UILabel alloc]init];
      _label1.frame = CGRectZero;
      _label1.numberOfLines = 0;
       [_label1 setFont:[UIFont boldSystemFontOfSize:13]];
       [self.contentView addSubview:_label1];
    
    
    
            _label2 = [[UILabel alloc]init];
      _label2.frame = CGRectZero;
      _label2.numberOfLines = 0;
       [_label2 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label2];
    
    
            _label3 = [[UILabel alloc]init];
      _label3.frame = CGRectZero;
      _label3.numberOfLines = 0;
       [_label3 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label3];
    
            _label4 = [[UILabel alloc]init];
      _label4.frame = CGRectZero;
      _label4.numberOfLines = 0;
       [_label4 setFont:[UIFont systemFontOfSize:13]];
//       [self.contentView addSubview:_label4];
    
_image = [[UIImageView alloc]init];
_image.frame = CGRectZero;
       [self.contentView addSubview:_image];
    
       _view1 = [[UIImageView alloc]init];
_view1.frame = CGRectZero;
       [self.contentView addSubview:_view1];
    
       _view2 = [[UIImageView alloc]init];
_view2.frame = CGRectZero;
       [self.view1 addSubview:_view2];
    
       
}

return self;

}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
//100
_image.frame = CGRectMake(10, 10, self.contentView.height-20, self.contentView.height-20);
_image.layer.cornerRadius = 40;
_image.layer.masksToBounds = YES;
NSString *url = [NSString stringWithFormat:@"%@%@",kip,_dic[@"imageUrl"]];
[self.image sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"加载"]];
_label1.frame = CGRectMake(_image.right+10, 10, 50, 20);
_label1.text = _dic[@"title"];
_label2.frame = CGRectMake(KScreenWidth-130, 10, 120, 20);
_label2.textAlignment = NSTextAlignmentRight;
if ([_Num isEqualToString:@"一"]||[_Num isEqualToString:@"二"]||[_Num isEqualToString:@"三"]) {
    _label2.textColor = [UIColor orangeColor];
}else{
    _label2.textColor = [UIColor blueColor];
}
NSString *number = [NSString stringWithFormat:@"%@",_dic[@"number"]];
    _label2.text = [NSString stringWithFormat:@"%@票第%@名",number,_Num];
_label3.frame = CGRectMake(_image.right+10, _label1.bottom, KScreenWidth-30-_image.width, 40);
if (![_dic[@"intro"] isEqual:[NSNull null]]) {
_label3.text = [NSString stringWithFormat:@"%@",_dic[@"intro"]];
}else{

        _label3.text =@"" ;

}
//_label4.frame = CGRectMake(_image.right+10, _label3.bottom,KScreenWidth-30-_image.width, 20);
//_label4.text = @"xxxxxxxxxxxxxxxx";
_view1.frame = CGRectMake(_image.right+10, _label1.bottom+40, KScreenWidth-30-_image.width, 20);
        _view1.layer.borderWidth = 1;
        _view1.layer.borderColor = [[UIColor blueColor] CGColor];
        _view1.backgroundColor = [UIColor whiteColor];
        int num = [number intValue];
    float ple =   (float) num/(float) _countnum;
_view2.frame = CGRectMake(2, 2, (_view1.width-4)*ple, _view1.height-4);
_view2.backgroundColor = [UIColor blueColor];
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
